package com.zls.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zls.pojo.TDevice;
import com.zls.pojo.TDeviceType;
import com.zls.pojo.TFarm;
import org.apache.ibatis.annotations.*;
import org.apache.ibatis.mapping.FetchType;

import java.util.List;

public interface TDeviceTypeMapper extends BaseMapper<TDeviceType> {

    @Select("<script>" +
            "select * from t_device_type where 1=1" +
            "<if test='queryString!=null'> and name like concat( '%',#{queryString},'%')" +
            "limit #{currentPage},#{pageSize}</if>" +
            "<if test='queryString==null'>limit #{currentPage},#{pageSize}</if> "+
            "</script>")
    List<TDeviceType> findPage(@Param("currentPage") Integer currentPage, @Param("pageSize") Integer pageSize, @Param("queryString") String queryString);

    //查询总记录数
    @Select("<script>" +
            "select count(*) from t_device_type where 1 =1" +
            "<if test='queryString!=null'> and name like concat( '%',#{queryString},'%') </if>" +
            "</script>")
    Long count(String queryString);
}
